var e = function(select) {
    return document.querySelector(select)
}

var log = function() {
    console.log.apply(console, arguments)
}

var ajax = function (method, path, data, callback) {
    var r = new XMLHttpRequest()
    r.open(method, path, true)
    r.setRequestHeader('Content-Type', "application/json")
    r.onreadystatechange = function () {
        if (r.readyState == 4) {
            callback(r.response)
        }
    }
    data = JSON.stringify(data)
    r.send(data)
}
